app.controller("studentController",function ($scope,$controller,classesService,studentService) {
    //代表继承自baseController
    $controller("baseController",{$scope:$scope});
    //1.查询所有学生
    $scope.findAll = function(){
        studentService.findAll().success( function(response){
            $scope.students = response;
        } )
    }
    //2.查询所有的班级
    $scope.findClasses=function () {
        classesService.findAll().success(function(response){
            $scope.classes = response;
        })
    }
    //3.条件查询带分页
    $scope.search =function(page,pagesize){
        studentService.search(page, pagesize, $scope.searchEntity).success(function(response){
            //① 指定每页的记录集合
            $scope.students=response.rows;
            //② 更新总记录数
            $scope.paginationConf.totalItems=response.total;
        })
    }
    $scope.searchStudent=function () {
        $scope.search($scope.paginationConf.currentPage,$scope.paginationConf.itemsPerPage);
    }

})